package edu.gatech.spacetraderteam3.model;

import edu.gatech.spacetraderteam3.controller.GUIEventHandler;

/**
 * All the possible actions a player can do during an encounter
 * @author TBW
 */
public enum EncounterAction {
    FLEE("Flee") {
        public void doAction() {
            GUIEventHandler.flee();
        }
    },
    ATTACK("Attack") {
        public void doAction() {
            GUIEventHandler.attack();
        }
    },
    TRADE("Trade") {
        public void doAction() {
            GUIEventHandler.trade();
        }
    },
    NO_TRADE("No Trade") {
        public void doAction() {
            GUIEventHandler.noTrade();
        }
    },
    LET_POLICE_BOARD("Let Board") {
        public void doAction() {
            GUIEventHandler.letPoliceBoard();
        }
    },
    OKAY("Okay") {
        public void doAction() {
            GUIEventHandler.noEvent();
        }
    },
    LET_PIRATES_BOARD("Let Board") {
        public void doAction() {
            GUIEventHandler.letPiratesBoard();
        }
    };
    
    /**
     * The name of the encounter
     */
    private final String displayName;
    
    /**
     * Sets the displayName of the encounter
     * @param displayName displayName to set
     */
    private EncounterAction(String displayName) {
        this.displayName = displayName;
    }

    /**
     * Gets the display name of the action
     * @return the display name
     */
    public String displayName() {
        return displayName;
    }

    /**
     * What method is called when the action is selected. Defined with the different enumerated types
     */
    public abstract void doAction();
}
